package fr.imag.m2pgi.m2m.geoloc;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Random;

public class LidarDummy implements Lidar {

  private boolean enabled = false; 
  private Random r = new Random();
  
  public boolean isEnabled() throws IOException {
    return enabled;
  }

  public void enable() throws IOException {
    this.enabled = true;
  }

  public void disable() throws IOException {
    this.enabled = false;
  }

  public int getRange(double angle) throws IOException {
    return r.nextInt(4096)+1;
  }

  public int getRange(ArrayList<Integer> data, double angle) throws IOException {
    return r.nextInt(4096)+1;
  }

  public ArrayList<Integer> getMeasures() throws IOException {
    ArrayList<Integer> res = new ArrayList<Integer>(680);
    for(int i=0; i<680; i++) {
      res.add(r.nextInt(4096)+1);
    }
    return res;
  }

}
